package com.example.pre.service.impl;

import java.util.Collection;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.pre.dao.ReimbursementDao;
import com.example.pre.model.Reimbursement;
import com.example.pre.service.ReimbursementService;

/*
 * 报销申请service层实现类
 */
@Service
public class ReimbursementServiceImpl implements ReimbursementService {

	@Autowired
	private ReimbursementDao reimbursementDao;

	@Override
	public Reimbursement get(int id) {
		return reimbursementDao.get(id);
	}

	@Override
	public Collection<Reimbursement> getAll() {
		return reimbursementDao.listByCondition(null);
	}

	@Override
	public boolean update(Reimbursement m) {
		return reimbursementDao.update(m) == 1;
	}

	@Override
	public boolean delete(int id) {
		return reimbursementDao.delete(id) == 1;
	}

	@Override
	public boolean create(Reimbursement m) {
		return reimbursementDao.create(m) == 1;
	}

	@Override
	public Collection<Reimbursement> listByCondition(Map<String, Object> whereColumn) {
		return reimbursementDao.listByCondition(whereColumn);
	}

	@Override
	public int countByCondition(Map<String, Object> whereColumn) {
		return reimbursementDao.countByCondition(whereColumn);
	}

}
